//
//  JSBaseWebViewController.h
//  NiubilityProject
//
//  Created by Apple on 2018/3/8.
//  Copyright © 2018年 Apple. All rights reserved.
//

#import "JSBaseViewController.h"
#import <WebKit/WebKit.h>

@interface JSBaseWebViewController : JSBaseViewController


@property (nonatomic,strong) WKWebView * webView;
@property (nonatomic,strong) UIProgressView * progressView;
@property (nonatomic) UIColor *progressViewColor;
@property (nonatomic,weak) WKWebViewConfiguration * webConfiguration;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *htmlString;

-(instancetype)initWithUrl:(NSString *)url naviTitle:(NSString *)titleStr;
-(instancetype)initWithHTMLStr:(NSString *)HTMLString naviTitle:(NSString *)titleStr;

//更新进度条
-(void)updateProgress:(double)progress;

//更新导航栏按钮，子类去实现
-(void)updateNavigationItems;

@end

@interface JSHandler : NSObject<WKScriptMessageHandler>
@property (nonatomic,weak,readonly) UIViewController * webVC;
@property (nonatomic,strong,readonly) WKWebViewConfiguration * configuration;

-(instancetype)initWithViewController:(UIViewController *)webVC configuration:(WKWebViewConfiguration *)configuration;

-(void)cancelHandler;

@end
